<?php

class WarehouseList extends CWidget {

    public function run() {
        $baseUrl = Yii::app()->request->baseUrl . '/';
        $region = $this->getController()->getRegion();
        $models = Yii::app()->db->getCommandBuilder()->createSqlCommand('SELECT * FROM mp_wares WHERE wh_region = ' . $region['id'])->queryAll();
        $this->render('warehouse', array('baseUrl' => $baseUrl, 'models' => $models));
    }

}
